const path = require("path")
const htmlWebpackPlugin = require("html-webpack-plugin")

module.exports = {
	entry: "./src/main.js",
	output: {
			filename: "./src/bundle.js",
			path: path.resolve(__dirname, "dist")
	},
	devServer: {
		port: 3000,
	},
	module: {
		rules: [
			{ 
				test: /\.pug$/,
				use: ["pug-loader"]
			},
			{
				test: /.scss$/,
				use: ["style-loader", "css-loader", "sass-loader"]
			},
			{
        test: /\.(png|jpg|jpeg|gif)$/,
        use: [
          {
            loader: 'url-loader',
            options: {
              limit: 500
            }
          }
        ]
      }
		],
	},
	plugins: [
		new htmlWebpackPlugin({
			template: path.join(__dirname, "./src/index.pug")
		})
	],

}